<%@page import="cn.yunhe.entity.ProvienceMessage"%>
<%@page import="cn.yunhe.entity.University"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>信息编辑</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="scripts/jquery/jquery-1.7.1.js"></script>
<link href="style/authority/basic_layout.css" rel="stylesheet" type="text/css">
<link href="style/authority/common_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="scripts/authority/commonAll.js"></script>
<script type="text/javascript" src="scripts/jquery/jquery-1.4.4.min.js"></script>
<script src="scripts/My97DatePicker/WdatePicker.js" type="text/javascript" defer="defer"></script>
<script type="text/javascript" src="scripts/artDialog/artDialog.js?skin=default"></script>
<script type="text/javascript">
	$(document).ready(function() {
		
		$("#submitbutton").click(function() {
			validateForm();
			parent.$.fancybox.close();
	});
		
		/*
		 * 提交
		 */
		/* $("#submitbutton").click(function() {
			if(validateForm()){
				//checke_avgSubmit();
				 $("#submitForm").submit(); //提交
	             parent.$.fancybox.close(); //关闭
				//$("#submitForm").attr("action", "DoEnroll?opt=update").submit();
			}
		}); */
		
		/* function checke_avgSubmit(){
			// 分别获取小区编号、栋号、层号、房号
			var e_low = $('e_low').val();
			var e_uni = $('#e_uni').val();
			var fyXqCode = $("#fyXq").val();
			var major = $("#major").val();
			var e_num = $("#e_num").val();	
			var e_avg = $("#e_avg").val();
			if(e_uni!="" && major!="" && e_num!="" && e_avg!=""&&e_low!=""){
				// 给房屋坐落地址赋值
				//$("#fyZldz").val($('#major option:selected').text()  + e_num + "-" + e_avg);
				// 异步判断该房室是否存在，如果已存在，给用户已提示哦
				$.ajax({
					type:"POST",
					url:"",
					data:{"fangyuanEntity.fyID":fyID,"fangyuanEntity.fyXqCode":fyXqCode, "major":major, "e_num":e_num, "e_avg":e_avg,"e_low":e_low},
					dataType : "text",
					success:function(data){
//	 					alert(data);
						// 如果返回数据不为空，更改“房源信息”
						if(data=="1"){
							 art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'该房室在系统中已经存在哦，\n请维护其他房室数据', ok:true,});
							 $("#e_avg").css("background", "#EEE");
							 $("#e_avg").focus();
							 return false;
						}else{
							$("#submitForm").attr("action", "/xngzf/archives/saveOrUpdateFangyuan.action").submit();
						}
					}
				});
			}
			return true;
		} */
		/*
		 * 取消
		 */
		$("#cancelbutton").click(function() {
			/**  关闭弹出iframe  **/
			window.parent.$.fancybox.close();
		});
		
		var result = 'null';
		if(result =='success'){
			/**  关闭弹出iframe  **/
			window.parent.$.fancybox.close();
		}
	});
	
	/** 表单验证  **/
	function validateForm(){
		if($("#major").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写专业', ok:true,});
			return false;
		}
		if($("#e_num").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写录取人数', ok:true,});
			return false;
		}
		if($("#e_avg").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写平均分', ok:true,});
			return false;
		}
		if($("#e_low").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写最低分', ok:true,});
			return false;
		}
		if($("#e_uni").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写学校名称', ok:true,});
			return false;
		}
		if($("#e_pro").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写省份名称', ok:true,});
			return false;
		}
		if($("#wenorli").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写文或理', ok:true,});
			return false;
		}
		return true;
	}
</script>
</head>
<body>
<form id="submitForm" name="submitForm" action="../DoEnroll?opt=add" method="post">
	<input type="hidden" name="fyID" value="14458625716623" id="fyID"/>
	<div id="container">
		<div id="nav_links">
			当前位置：表单管理&nbsp;>&nbsp;<span style="color: #1A5CC6;">录取情况管理</span>
			<div id="page_close">
				<a href="javascript:parent.$.fancybox.close();">
					<img src="images/common/page_close.png" width="20" height="20" style="vertical-align: text-top;"/>
				</a>
			</div>
		</div>
		<div class="ui_content">
			<table  cellspacing="0" cellpadding="0" width="100%" align="left" border="0">
				<tr>
					<td class="ui_text_rt">专业</td>
					<td class="ui_text_lt">
						<input type="text" name="major" id="major" class="ui_input_txt02"/>
					</td>
				</tr>
				<tr>
					<td class="ui_text_rt">录取人数</td>
					<td class="ui_text_lt">
						<input type="text" id="e_num" name="e_num"  class="ui_input_txt02"/>
					</td>
				</tr>
				<tr>
					<td class="ui_text_rt">录取平均分</td>
					<td class="ui_text_lt">
						<input type="text" id="e_avg" name="e_avg"  class="ui_input_txt02"/>
					</td>
				</tr>
				<tr>
					<td class="ui_text_rt">录取最低分</td>
					<td class="ui_text_lt">
						<input type="text" id="e_low" name="e_low"  class="ui_input_txt02"/>
					</td>
				</tr>
				<tr>
					<td class="ui_text_rt">学校名称</td>
					<td class="ui_text_lt">
					<c:set value="${sessionScope.universtitylist}" var="ulist"></c:set>
					<c:remove var="universtitylist"/>
					<c:forEach items="${ulist}" var="u">
						<select id="e_uni" name="e_uni" class="ui_select01">
                            <option value="">--请选择--</option>
                            <option value="${u.universityid}">${u.uname}</option>
                        </select>
					</c:forEach>
						
					</td>
				</tr>
				<tr>
					<td class="ui_text_rt">省份名称</td>
					<td class="ui_text_lt">
					<c:set value="${sessionScope.proList}" var="pmlist"></c:set>
					<c:remove var="proList"/>
					
						<select id="e_pro" name="e_pro" class="ui_select01">
                            <option value="">--请选择--</option>
                            <c:forEach items="${pmlist}" var="pm">
                            <option value="${pm.p_id}">${pm.p_name}</option>
                            </c:forEach>
                        </select>
					
					</td>
				</tr>
				<tr>
					<td class="ui_text_rt">文或理</td>
					<td class="ui_text_lt">
						<select id="wenorli" name="wenorli" class="ui_select02" >
                            <option value="">--请选择--</option>
                            <option value="0" selected="selected">文</option>
                            <option value="1">理</option>
                        </select>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td class="ui_text_lt">
						&nbsp;<input id="submitbutton" type="submit" value="提交" class="ui_input_btn01"/>
						&nbsp;<input id="cancelbutton" type="button" value="取消" class="ui_input_btn01"/>
					</td>
				</tr>
			</table>
		</div>
	</div>
</form>
</body>
</html>